package context.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class MyDriverLoadingListener implements ServletContextListener{

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
			System.out.println("꼴까닥.");	
	}

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		System.out.println("contextInitialized...call....");
		//ServletContext리턴받아서 / getInitParameter()로 dd에 설정된 값을 가져온다...
		
		try{
			String ODriver=sce.getServletContext().getInitParameter("ODriver");
			Class.forName(ODriver);
			System.out.println("드라이버 로딩...Listener이용...");
		}catch(ClassNotFoundException e){
			System.out.println("드라이버 로딩 실패.....");
		}
	}

}












